/**
 */
package de.thwildau.tm.moses.asn1.asn1.impl;

import de.thwildau.tm.moses.asn1.asn1.Asn1Package;
import de.thwildau.tm.moses.asn1.asn1.ExtensionAdditionAlternative;
import de.thwildau.tm.moses.asn1.asn1.ExtensionAdditionAlternativesList;

import java.util.Collection;

import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;

import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Extension Addition Alternatives List</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link de.thwildau.tm.moses.asn1.asn1.impl.ExtensionAdditionAlternativesListImpl#getExtensionAdditionAlternative <em>Extension Addition Alternative</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class ExtensionAdditionAlternativesListImpl extends MinimalEObjectImpl.Container implements ExtensionAdditionAlternativesList
{
  /**
   * The cached value of the '{@link #getExtensionAdditionAlternative() <em>Extension Addition Alternative</em>}' containment reference list.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getExtensionAdditionAlternative()
   * @generated
   * @ordered
   */
  protected EList<ExtensionAdditionAlternative> extensionAdditionAlternative;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected ExtensionAdditionAlternativesListImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  protected EClass eStaticClass()
  {
    return Asn1Package.Literals.EXTENSION_ADDITION_ALTERNATIVES_LIST;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EList<ExtensionAdditionAlternative> getExtensionAdditionAlternative()
  {
    if (extensionAdditionAlternative == null)
    {
      extensionAdditionAlternative = new EObjectContainmentEList<ExtensionAdditionAlternative>(ExtensionAdditionAlternative.class, this, Asn1Package.EXTENSION_ADDITION_ALTERNATIVES_LIST__EXTENSION_ADDITION_ALTERNATIVE);
    }
    return extensionAdditionAlternative;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
  {
    switch (featureID)
    {
      case Asn1Package.EXTENSION_ADDITION_ALTERNATIVES_LIST__EXTENSION_ADDITION_ALTERNATIVE:
        return ((InternalEList<?>)getExtensionAdditionAlternative()).basicRemove(otherEnd, msgs);
    }
    return super.eInverseRemove(otherEnd, featureID, msgs);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case Asn1Package.EXTENSION_ADDITION_ALTERNATIVES_LIST__EXTENSION_ADDITION_ALTERNATIVE:
        return getExtensionAdditionAlternative();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @SuppressWarnings("unchecked")
  @Override
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
      case Asn1Package.EXTENSION_ADDITION_ALTERNATIVES_LIST__EXTENSION_ADDITION_ALTERNATIVE:
        getExtensionAdditionAlternative().clear();
        getExtensionAdditionAlternative().addAll((Collection<? extends ExtensionAdditionAlternative>)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case Asn1Package.EXTENSION_ADDITION_ALTERNATIVES_LIST__EXTENSION_ADDITION_ALTERNATIVE:
        getExtensionAdditionAlternative().clear();
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case Asn1Package.EXTENSION_ADDITION_ALTERNATIVES_LIST__EXTENSION_ADDITION_ALTERNATIVE:
        return extensionAdditionAlternative != null && !extensionAdditionAlternative.isEmpty();
    }
    return super.eIsSet(featureID);
  }

} //ExtensionAdditionAlternativesListImpl
